import { useCounterStore } from '../stores/counter'
import { storeToRefs } from 'pinia'

//分开使用,避免多个api造成失效
export  function useLoading() {
    let store = useCounterStore()
    let { isloading } = storeToRefs(store)
    //Flag:连接超时设置
    return function () {
        isloading.value=true
    }
}
export function cancelLoading() { 
    let store = useCounterStore()
    let { isloading } = storeToRefs(store)
    //Flag:连接超时设置
    return function () {
        isloading.value = false
    }
}